/*
 * $Id: BaseProgramme.java 3 2011-12-26 07:48:43Z forwardly@hotmail.com $
 * 
 * Copyright (c) 2001-2008 Accentrix Company Limited. All Rights Reserved.
 * 
 * Accentrix Company Limited. ("Accentrix") retains copyright on all text, source
 * and binary code contained in this software and documentation. Accentrix grants
 * Licensee a limited license to use this software, provided that this copyright
 * notice and license appear on all copies of the software. The software source
 * code is provided for reference purposes only and may not be copied, modified 
 * or distributed.
 * 
 * THIS SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS," WITHOUT ANY WARRANTY OF
 * ANY KIND UNLESS A SEPARATE WARRANTIES IS PURCHASED FROM ACCENTRIX AND REMAINS
 * VALID.  ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ACCENTRIX SHALL NOT BE LIABLE
 * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING OR MODIFYING THE
 * SOFTWARE OR ITS DERIVATIVES.
 * 
 * IN NO EVENT WILL ACCENTRIX BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
 * HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE
 * USE OF OR INABILITY TO USE SOFTWARE, EVEN IF ACCENTRIX HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */
package com.lightsaber.trade.as.entity.programme;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.lightsaber.trade.core.entity.BaseEntity;

@Entity
@Table(name = "MHPP_PROGRAMME")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "PROGRAMME_KIND", discriminatorType = DiscriminatorType.STRING)
public abstract class BaseProgramme extends BaseEntity {

    private static final long serialVersionUID = -6360986547982446937L;

    // ------------------ Extends from parent Programme--------------------START
    @Column(name = "CODE", nullable = false, length = 100)
    private String code;

    @Column(name = "DURATION", nullable = true)
    private Integer duration;

    @Column(name = "DURATION_TYPE", nullable = true)
    @Enumerated(EnumType.STRING)
    private DurationType durationType;
    // ------------------ Extends from parent Programme--------------------END

    @Column(name = "TITLE_SHORT", length = 100)
    private String titleShort;

    @Column(name = "TITLE_LONG", length = 1000)
    private String titleLong;

    @Column(name = "TITLE_ZH_SHORT", length = 100)
    private String titleZhShort;

    @Column(name = "TITLE_ZH_LONG", length = 1000)
    private String titleZhLong;
    
    //remove by dj
    @Column(name = "STATUS", nullable = true)
    private ProgrammeStatus status;
    
    @Column(name = "PROGRAMME_KIND", insertable = false, updatable = false)
    private String programmeKind;

    @OneToMany(mappedBy = "programme", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<OfferingCampus> offeringCampusList;

    @OneToMany(mappedBy = "programme", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<ProgrammePlanProjectionType> programmePlanProjectionTypes;

    @OneToMany(mappedBy = "programme", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<CurriculumHour> curriculumHours;

    @OneToMany(mappedBy = "programme", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<ProgrammeLeader> programmeLeaders;

    public List<OfferingCampus> getOfferingCampusList() {
        return offeringCampusList;
    }

    public String getCode() {
        return code;
    }

    public void setCode(final String code) {
        this.code = code;
    }

    public void setOfferingCampusList(final List<OfferingCampus> offeringCampusList) {
        this.offeringCampusList = offeringCampusList;
    }

    public List<ProgrammePlanProjectionType> getProgrammePlanProjectionTypes() {
        return programmePlanProjectionTypes;
    }

    public void setProgrammePlanProjectionTypes(
            final List<ProgrammePlanProjectionType> programmePlanProjectionTypes) {
        this.programmePlanProjectionTypes = programmePlanProjectionTypes;
    }

    public List<CurriculumHour> getCurriculumHours() {
        return curriculumHours;
    }

    public void setCurriculumHours(final List<CurriculumHour> curriculumHours) {
        this.curriculumHours = curriculumHours;
    }

    public List<ProgrammeLeader> getProgrammeLeaders() {
        return programmeLeaders;
    }

    public void setProgrammeLeaders(final List<ProgrammeLeader> programmeLeaders) {
        this.programmeLeaders = programmeLeaders;
    }

    public String getTitleShort() {
        return titleShort;
    }

    public void setTitleShort(final String titleShort) {
        this.titleShort = titleShort;
    }

    public String getTitleLong() {
        return titleLong;
    }

    public void setTitleLong(final String titleLong) {
        this.titleLong = titleLong;
    }

    public String getTitleZhShort() {
        return titleZhShort;
    }

    public void setTitleZhShort(final String titleZhShort) {
        this.titleZhShort = titleZhShort;
    }

    public String getTitleZhLong() {
        return titleZhLong;
    }

    public void setTitleZhLong(final String titleZhLong) {
        this.titleZhLong = titleZhLong;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(final Integer duration) {
        this.duration = duration;
    }

    public DurationType getDurationType() {
        return durationType;
    }

    public void setDurationType(final DurationType durationType) {
        this.durationType = durationType;
    }

    public String getProgrammeKind() {
        return programmeKind;
    }

    public void setProgrammeKind(final String programmeKind) {
        this.programmeKind = programmeKind;
    }
    
    public ProgrammeStatus getStatus() {
        return status;
    }

    public void setStatus(final ProgrammeStatus status) {
        this.status = status;
    }
}
